import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int[] imparipinnate = new int[32];
        int[] paripinnate = new int[32];
        int i = 31;
        int j = 30;
        while (a != 0){
            if (a != 0){
                imparipinnate[i] = a & 1;
                i--;
                a = a>>>2;
            }
            if (a != 0){
                paripinnate[j] = a & 1;
                j--;
                a = a>>>2;
            }
        }
        System.out.println(Arrays.toString(imparipinnate));
        System.out.println(Arrays.toString(paripinnate));
        long end = System.currentTimeMillis();
        System.out.println("共耗时"+(end-start)+"毫秒");
    }
}
